package com.xzr.factories;

public class SecondFactory {
    public Object doPerson(String citizenship){
        try {
           Object o =  Class.forName("com.xzr.impl."+citizenship).newInstance();
           return o;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
